package servlet;

public abstract class HttpServlet implements Servlet {

    public abstract void doPost(Request request, Response response) throws Exception;

    public abstract void doGet(Request request, Response response) throws  Exception;


    @Override
    public void service(Request request, Response response) throws Exception {
        //请求进行解析操作

        if("GET".equals(request.getMethod())){
            doGet(request, response);
        }else if("POST".equals(request.getMethod())){
            doPost(request, response);
        }
    }
}
